
import LoadAble from "../hoc/LoadAble";

const routes = [
  {
    path:'/login',
    component:LoadAble(()=>import('../views/login/login'))
  },
  {
    path:'/register',
    component:LoadAble(()=>import('../views/register/register'))
  },
  {
    path:'/main',
    component:LoadAble(()=>import('../views/main/main')),
    routes:[
      {
        path:'/main/list',
        component:LoadAble(()=>import('../views/mainList/mainList'))
      },
      {
        path:'/main/detail/:id',
        component:LoadAble(()=>import('../views/mainDetail/mainDetail'))
      },
      {
        path:'/main/info',
        component:LoadAble(()=>import('../views/info/info'))
      },
      {
        path:'/main/changePwd',
        component:LoadAble(()=>import('../views/changePwd/changePwd'))
      },
      {
        path:'/main/publish',
        component:LoadAble(()=>import('../views/publish/publish'))
      },
      {
        from:'/main',
        redirect:'/main/list'
      },
    ]
  },
  {
    from:'/',
    redirect:'/main'
  },
  {
    path:'*',
    component:LoadAble(()=>import('../views/main/main'))
  }

];

export default routes
